<!DOCTYPE html>
<html lang="en">

<head>
    <title>html5</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
    <div id="test" data-age="30">
        content
    </div>

    <script>
        var test = document.getElementById("test");
        test.dataset.age = "30";
    </script>
</body>

</html>